package com.txh.blog.dao;


import com.txh.blog.bean.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;


@Mapper
public interface CommentDao {

    //根据创建时间倒序来排
    List<Comment> selectRoot(@Param("blogId") Long blogId, @Param("blogParentId") Long blogParentId);
    //查询父级对象
    Comment selectById(@Param("CommentId")Long parentCommentId,@Param("blogId")Long blogId);
    List<Comment> recursionChildren(@Param("CommentId")Long parentCommentId,@Param("blogId")Long blogId);
    //添加一个评论
    int saveComment(Comment comment);
}
